package com.cj.user.service.demo;

import com.alibaba.fastjson.JSONObject;

import java.text.SimpleDateFormat;
import java.util.*;

/**
 * @Author cheng jun
 * @Description:
 * @Date 2021/6/28 15:52
 */
public class Demo8 {

    public static int demo() {
        System.out.println("aaa");
        return 1;
    }

    public static void main(String[] args) {
        /*Calendar calendar = new GregorianCalendar();
        SimpleDateFormat simpleDateFormat = new SimpleDateFormat("yyyy-MM-dd 17:00:00");
        calendar.setTime(new Date());
        calendar.add(calendar.DATE,-1);
        String date2= simpleDateFormat.format(calendar.getTime());
        System.out.println(date2);*/
        //demo();
        /*String path = new SimpleDateFormat("yyyyMMddhhmmss").format(new Date()) + UUID.randomUUID().toString().replace("-", "");
        System.out.println(path);*/

        List<Map<String, Object>> list = new ArrayList<>();
        Map<String, Object> map = new HashMap<>();
        map.put("aaa", 123);
        map.put("bbb", 234);
        Map<String, Object> map2 = new HashMap<>();
        map2.put("ccc", 345);
        map2.put("ddd", 456);
        list.add(map);
        list.add(map2);
        byte[] bytes = JSONObject.toJSONString(list).getBytes();
        System.out.println((List<Map<String, Object>>) JSONObject.parse(bytes));

    }
}
